package com.compomics.spectrawl.gui.view;

import java.awt.Color;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

/**
 *
 * @author Niels Hulstaert
 */
public class MzDeltaFilterDialog extends javax.swing.JDialog {

    /**
     * Creates new form FilterConfigDialog
     */
    public MzDeltaFilterDialog(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.getContentPane().setBackground(Color.WHITE);
        setLocationRelativeTo(parent);
    }

    public JButton getAddMzDeltaButton() {
        return addMzDeltaButton;
    }

    public JTextField getAddMzDeltaTextField() {
        return addMzDeltaTextField;
    }

    public JRadioButton getAndRadioButton() {
        return andRadioButton;
    }

    public ButtonGroup getFilterTypeRadioButtonGroup() {
        return filterTypeRadioButtonGroup;
    }

    public JTextField getIntensityThresholdTextField() {
        return intensityThresholdTextField;
    }

    public JList getMzDeltaFilterList() {
        return mzDeltaFilterList;
    }

    public JRadioButton getOrRadioButton() {
        return orRadioButton;
    }

    public JButton getRemoveMzDeltaButton() {
        return removeMzDeltaButton;
    }    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        filterTypeRadioButtonGroup = new javax.swing.ButtonGroup();
        filterSettingsTabbedPane = new javax.swing.JTabbedPane();
        mzDeltaFilterPanel = new javax.swing.JPanel();
        mzDeltaFilterScrollPane = new javax.swing.JScrollPane();
        mzDeltaFilterList = new javax.swing.JList();
        addMzDeltaLabel = new javax.swing.JLabel();
        addMzDeltaTextField = new javax.swing.JTextField();
        addMzDeltaButton = new javax.swing.JButton();
        removeMzDeltaButton = new javax.swing.JButton();
        intensityThresholdLabel = new javax.swing.JLabel();
        intensityThresholdTextField = new javax.swing.JTextField();
        filterTypeLabel = new javax.swing.JLabel();
        andRadioButton = new javax.swing.JRadioButton();
        orRadioButton = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(650, 350));

        mzDeltaFilterPanel.setMinimumSize(new java.awt.Dimension(4, 4));
        mzDeltaFilterPanel.setOpaque(false);
        mzDeltaFilterPanel.setPreferredSize(new java.awt.Dimension(4, 4));

        mzDeltaFilterScrollPane.setViewportView(mzDeltaFilterList);

        addMzDeltaLabel.setText("M/Z delta");

        addMzDeltaTextField.setPreferredSize(new java.awt.Dimension(6, 25));

        addMzDeltaButton.setText("add");
        addMzDeltaButton.setMaximumSize(new java.awt.Dimension(97, 23));
        addMzDeltaButton.setMinimumSize(new java.awt.Dimension(97, 23));
        addMzDeltaButton.setPreferredSize(new java.awt.Dimension(97, 23));

        removeMzDeltaButton.setText("remove");
        removeMzDeltaButton.setMaximumSize(new java.awt.Dimension(97, 23));
        removeMzDeltaButton.setMinimumSize(new java.awt.Dimension(97, 23));
        removeMzDeltaButton.setPreferredSize(new java.awt.Dimension(97, 23));

        intensityThresholdLabel.setText("Intensity threshold");

        intensityThresholdTextField.setPreferredSize(new java.awt.Dimension(6, 25));

        filterTypeLabel.setText("Filter type");

        andRadioButton.setText("and");

        orRadioButton.setText("or");

        javax.swing.GroupLayout mzDeltaFilterPanelLayout = new javax.swing.GroupLayout(mzDeltaFilterPanel);
        mzDeltaFilterPanel.setLayout(mzDeltaFilterPanelLayout);
        mzDeltaFilterPanelLayout.setHorizontalGroup(
            mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mzDeltaFilterPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mzDeltaFilterPanelLayout.createSequentialGroup()
                        .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(mzDeltaFilterPanelLayout.createSequentialGroup()
                                .addComponent(intensityThresholdLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(intensityThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(mzDeltaFilterPanelLayout.createSequentialGroup()
                                .addComponent(addMzDeltaLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(addMzDeltaTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(12, 12, 12))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mzDeltaFilterPanelLayout.createSequentialGroup()
                        .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mzDeltaFilterPanelLayout.createSequentialGroup()
                                .addComponent(filterTypeLabel)
                                .addGap(18, 18, 18)
                                .addComponent(andRadioButton)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(orRadioButton))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mzDeltaFilterPanelLayout.createSequentialGroup()
                                .addComponent(addMzDeltaButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(removeMzDeltaButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(mzDeltaFilterScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 618, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        mzDeltaFilterPanelLayout.setVerticalGroup(
            mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mzDeltaFilterPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(intensityThresholdLabel)
                    .addComponent(intensityThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(mzDeltaFilterScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addMzDeltaTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(addMzDeltaLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addMzDeltaButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(removeMzDeltaButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(mzDeltaFilterPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(andRadioButton)
                    .addComponent(filterTypeLabel)
                    .addComponent(orRadioButton))
                .addContainerGap())
        );

        filterSettingsTabbedPane.addTab("M/Z delta filter settings", mzDeltaFilterPanel);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(filterSettingsTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 650, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(filterSettingsTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addMzDeltaButton;
    private javax.swing.JLabel addMzDeltaLabel;
    private javax.swing.JTextField addMzDeltaTextField;
    private javax.swing.JRadioButton andRadioButton;
    private javax.swing.JTabbedPane filterSettingsTabbedPane;
    private javax.swing.JLabel filterTypeLabel;
    private javax.swing.ButtonGroup filterTypeRadioButtonGroup;
    private javax.swing.JLabel intensityThresholdLabel;
    private javax.swing.JTextField intensityThresholdTextField;
    private javax.swing.JList mzDeltaFilterList;
    private javax.swing.JPanel mzDeltaFilterPanel;
    private javax.swing.JScrollPane mzDeltaFilterScrollPane;
    private javax.swing.JRadioButton orRadioButton;
    private javax.swing.JButton removeMzDeltaButton;
    // End of variables declaration//GEN-END:variables
}
